using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using UnityEngine;
using UnityEngine.EventSystems;

public class Lattice : MonoBehaviour
{
    public GameObject RedLattice;
    public GameObject GreenLattice;
    public GameObject YellowLattice;
    public Vector2Int position;

    public BaseChessDateSo chessDate;
    public Chess chess;
    public bool canClick = false;
    

    public void SetLatticeColor(Color color)
    {
        if (color == Settings.canPlaced)
        {
            GreenLattice.SetActive(true);
        }
        if (color == Settings.isInAttackRange)
        {
            YellowLattice.SetActive(true);
        }
        if (color == Settings.canAttack)
        {
            RedLattice.SetActive(true);
        }

        if (color == Settings.clear)
        {
            RedLattice.SetActive(false);
            GreenLattice.SetActive(false);
            YellowLattice.SetActive(false);
        }
        
    }
    


    public void SetChessDate(BaseChessDateSo chessDateSo,Chess c)
    {
        chessDate = chessDateSo;
        chess = c;
    }

    public void AddClickListener()
    {
        canClick = true;
    }

    public void RemoveClickListener()
    {
        canClick = false;
    }
    
    
}
